Phase 3B baseline replacement plan — supersedes PR #248 (docs only)#250
Open
mdtazizulislam wants to merge 1 commit into
Open
Phase 3B baseline replacement plan — supersedes PR #248 (docs only)#250mdtazizulislam wants to merge 1 commit into
mdtazizulislam wants to merge 1 commit into
Conversation
B3 PG18 verification proved PR #248's initDatabase()-derived baseline is unfaithful to production. Apples-to-apples catalog counts (throwaway PG16): initDatabase() = 125 tables / 1595 cols / 400 idx / 267 fk; real prod (operator PG18/Gate 1 snapshot) = 125 / 1649 / 402 / 266. Applying all 24 hand-written migration .sql files on top of initDatabase() moved columns only 1595->1596 — so ~53 prod columns (+2 indexes, -1 FK) exist in NO source of truth = undocumented production drift. Consequence: PR #248 baseline superseded. The authoritative 0000_prod_baseline must be introspected from the REAL Gate 1 snapshot (operator, PG18), not initDatabase(). Deliverables: 01_DRIFT_FINDING.md (evidence), 02_REPLACEMENT_RUNBOOK.md (operator regenerate on PG18 + normalized diff / drift inventory + journal + seeded db:migrate zero-DDL proof + commit to replacement PR). Diagnostics ran on throwaway PG16 (torn down); production untouched; PR #248 stays unmerged. No production deploy/migration execution/schema application/backend wiring/ feature-flag activation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MiPyhqoV9Pt7XN2tiFpS4A
✅ Deploy Preview for zonforge-customer-operations canceled.
|
✅ Deploy Preview for ai-powered-cyber ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mdtazizulislam
pushed a commit
that referenced
this pull request
Jul 8, 2026
…fication Evidence-based verification of the P1 baseline chain on a throwaway local PostgreSQL 16 cluster (created and destroyed in-session; production never touched): - PR #250's drift finding independently corroborated: PR #248's initDatabase()-derived candidate re-materialized and counted with the operator's exact catalog queries — 125 tables / 1595 columns / 400 indexes / 275 non-PK / 267 FKs, matching the drift table exactly and confirming the ~54-column shortfall vs production (1649). - Guard checks on main: db:migrate inert (no meta/_journal.json — migrate.ts skips), no prod-baseline directory merged, baseline-preview quarantined, initDatabase() still the runtime schema source (the drift engine). - New finding feeding back into PR #250's runbook: the Step 2 artifact fix (grep int4_ops) is too narrow — 149 wrong-opclass tokens exist in at least three forms, including text_ops-on-timestamptz which hard-fails on apply (reproduced); amendment: normalize ALL explicit opclass tokens. - Hard gates documented: the Gate 1 production snapshot is operator-held (no dump in-tree) and PG18 requires Docker (no daemon here) — so the final authoritative baseline is operator-executed per the amended runbook; fabricating it from in-repo sources is explicitly not done. - Verdict + exact remaining path: merge PR #250, close PR #248 as superseded, operator runs the amended runbook, commit the 1649-column authoritative baseline; then P2. Docs only — no code changes, no migrations, no schema changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMnfvQvtgNQwiUvPJ4ff8Z
15 tasks
mdtazizulislam
added a commit
that referenced
this pull request
Jul 8, 2026
…fication (#279) Production Readiness P1: evidence-based verification of the authoritative database baseline plan. Docs-only — adds docs/audit/production-readiness/P1_AUTHORITATIVE_BASELINE.md (132 lines). - Independently corroborated PR #250's drift finding: PR #248's initDatabase()-derived candidate re-materialized on a throwaway PostgreSQL 16.13 cluster reproduces every candidate-side count exactly (125 tables / 1595 columns / 400 indexes / 275 non-PK / 267 FKs) vs real production's 1649 columns — the candidate must never be adopted. - New finding (runbook amendment): the replacement runbook's opclass fix step is too narrow — 149 wrong-opclass tokens in three forms, including text_ops on timestamptz which hard-fails on apply; amendment: normalize ALL <type>_ops tokens. - Guard verification on main: no live migration journal (db:migrate inert), no prod-baseline directory, baseline-preview quarantined, initDatabase() drift engine documented. - Final baseline generation remains operator-gated (Gate 1 snapshot + PG18); no baseline adopted, no schema changes, no code changes. - Throwaway cluster destroyed and verified.
mdtazizulislam
pushed a commit
that referenced
this pull request
Jul 8, 2026
Evidence-based PG18 verification, executed on a genuine PostgreSQL 18.4 server obtained without Docker (npm @embedded-postgres/linux-x64). Docs-only: adds docs/audit/production-readiness/P2_PG18_VERIFICATION.md. - Candidate baseline (normalized per P1 amendment) applies cleanly on PG18.4 with identical structural counts to PG16 and PR #250 (125/1595/400/275/267); raw candidate hard-fails on PG18 exactly as on PG16, re-proving the normalize-all-opclasses amendment. - Zero-DDL mark-as-applied, journal integrity, and replay safety proven end-to-end on PG18 with the real drizzle migrator; drizzle hash = sha256 of the shipped SQL file. - Rollback safety: full baseline is transactional DDL on PG18 (explicit ROLLBACK and mid-apply failure both leave 0 objects). - Live initDatabase() engine runs cleanly on PG18.4 (0 failures, pgcrypto OK, identical shape) — the app can start on PG18 today. - Integrity: 0 invalid indexes, 0 unvalidated constraints, amcheck bt_index_check passes 400/400 btree indexes. - New runbook amendment: introspected SQL ships fully block-commented and applies as a silent no-op (rc 0, zero objects) unless uncommented. - P1 errata recorded (byte size 169,833; opclass token counts 437 total / ~189 wrong). Snapshot-dependent items remain operator-gated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMnfvQvtgNQwiUvPJ4ff8Z
8 tasks
mdtazizulislam
added a commit
that referenced
this pull request
Jul 8, 2026
Production Readiness P2: evidence-based PostgreSQL 18 verification, executed on a genuine PostgreSQL 18.4 server obtained without Docker (npm @embedded-postgres/linux-x64). Docs-only — adds docs/audit/production-readiness/P2_PG18_VERIFICATION.md (193 lines). - Normalized candidate baseline applies cleanly on PG18.4 with counts identical to PG16 and PR #250 (125/1595/400/275/267); raw candidate hard-fails on PG18 as on PG16, re-proving the normalize-all-opclasses amendment. - Zero-DDL mark-as-applied, journal integrity, and replay safety proven end-to-end with the real drizzle migrator (hash = sha256 of file). - Rollback safety: full baseline is transactional DDL on PG18. - Live initDatabase() runs cleanly on PG18.4 (0 failures, pgcrypto OK, identical shape). - Integrity: 0 invalid indexes, 0 unvalidated constraints, amcheck passes 400/400 btree indexes. - New runbook amendment: introspected SQL ships block-commented and is a silent no-op unless uncommented (rc 0, zero objects). - P1 errata recorded (169,833 bytes; 437 opclass tokens / ~189 wrong). - Snapshot-dependent items remain operator-gated; no baseline adopted, no schema/code changes, no production deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
B3 PG18 verification proved PR #248's
initDatabase()-derived baseline is not faithful to production. This package documents the confirmed drift and the plan to regenerate the authoritative0000_prod_baselinefrom the operator's real Gate 1 snapshot on PG18. Docs only — no production deploy, migration execution, schema application, backend wiring, or feature-flag activation. PR #248 stays unmerged and is superseded.Confirmed drift (apples-to-apples, same catalog queries, throwaway PG16)
initDatabase())Applying all 24 hand-written migration
.sqlfiles on top ofinitDatabase()moved columns only 1595 → 1596. So ~53 production columns (+2 indexes, −1 FK) exist in no source of truth — undocumented production drift (the core Phase-3 problem). The earlier "measurement artifact?" question is settled: measured identically, the gap is real.Consequence
Deliverables
01_DRIFT_FINDING.md— full evidence (apples-to-apples counts + the migration test).02_REPLACEMENT_RUNBOOK.md— operator steps on PG18: regenerate from the real snapshot → fix theint4_opsartifact → normalized structural diff (captures the ~54-column drift inventory) → build journal → prove seededdb:migrateskips with zero DDL (the step B3 blocked) → commit to this replacement PR.Next / decision
Operator runs the replacement runbook on PG18. On PASS, the snapshot-derived baseline supersedes PR #248 (close #248 in its favor), B3 clears, and B2 (restore/PITR) is next — all separately approved. The drift inventory from the diff also feeds Phase 3C convergence.
Guardrails honored
db:migratestill no-op; PR [SUPERSEDED by #250] Phase 3B promotion execution prep — 0000_prod_baseline (B1) #248 unmerged🤖 Generated with Claude Code
Generated by Claude Code